﻿    <Window x:Class="MvvmCodeReduction.View.CodeBehind.CustomersCodeBehind"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Code Behind" Height="200" Width="200">
    <Grid>
        <ItemsControl Name="CustomersItemsControl" ItemsSource="{Binding}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Border Name="border"
                            BorderBrush="Aqua"
                            CornerRadius="5"
                            BorderThickness="1"
                            Padding="5"
                            Margin="5">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="auto" />
                                <ColumnDefinition Width="auto" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Name="NameTextBlock"
                                       Text="{Binding Name}" />
                            <TextBox Name="EditTextBox"
                                     Visibility="Collapsed"/>
                            <Button Name="EditButton"
                                    Content="Edit"
                                    Click="EditButton_Click"
                                    Grid.Column="1" />
                            <Button Name="SaveButton"
                                    Content="Save"
                                    IsEnabled="False"
                                    Click="SaveButton_Click"
                                    Grid.Column="2" />
                        </Grid>
                    </Border>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </Grid>
</Window>
